
/**
 * 设备匹配器
 * 0 default 默认
 * 31 tv 电视机
 * 32 aircondition 空调
 * 33 curtain 窗帘
 * 34 light 灯光
 * 35 sweeper 扫地机器人
 * 36 pet 宠物狗
 * 37 robot 机器人
 * 38 fire 火灾模拟
 * 41 rice 电饭锅
 * 42 door 门
**/
export function deviceMatcher(deviceTypeNumber){
	let deviceType = ''
	let deviceTypeEnglish = ''
	switch(deviceTypeNumber){
		case 31:
			deviceType = '电视机'
			deviceTypeEnglish = 'tv'
			break
		case 32:
			deviceType = '空调'
			deviceTypeEnglish = 'aircondition'
			break
		case 33:
			deviceType = '窗帘'
			deviceTypeEnglish = 'curtain'
			break
		case 34:
			deviceType = '灯光'
			deviceTypeEnglish = 'light'
			break
		case 35:
			deviceType = '扫地机器人'
			deviceTypeEnglish = 'sweeper'
			break
		case 36:
			deviceType = '宠物狗'
			deviceTypeEnglish = 'pet'
			break
		case 37:
			deviceType = '机器人'
			deviceTypeEnglish = 'robot'
			break
		case 38:
			deviceType = '火灾模拟'
			deviceTypeEnglish = 'fire'
			break
		case 41:
			deviceType = '电饭锅'
			deviceTypeEnglish = 'rice'
			break
		case 42:
			deviceType = '门'
			deviceTypeEnglish = 'door'
			break		
	}
	return {'type':deviceType, 'typeEng':deviceTypeEnglish}
}




/**
 * 设备选择器
 * 0 default 默认
 * 31 tv 电视机
 * 32 aircondition 空调
 * 33 curtain 窗帘
 * 34 light 灯光
 * 35 sweeper 扫地机器人
 * 36 pet 宠物狗
 * 37 robot 机器人
 * 38 fire 火灾模拟
 * 41 rice 电饭锅
 * 42 door 门
**/
export function deviceChooser(deviceTypeNumber, roomId, roomName){
	let baseUri = '/pages/work/device'
	let deviceType = deviceMatcher(deviceTypeNumber).type
	let deviceTypeEnglish = deviceMatcher(deviceTypeNumber).typeEng
	return baseUri+`?type=${'智能'+deviceType}&typeEng=${deviceTypeEnglish}&room=${roomId}&roomName=${roomName}`
}